#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
	int findPeakElement(vector<int>& nums) {
		int size = nums.size();
		int l = 0;
		int r = size - 1;
		while (l < r) {
			int m = ((r-l) >> 1) + l;
			// 与右边的值进行比较
			if (nums[m] < nums[m+1]) {
				l = m + 1;
			} else {
				r = m;
			}
		}
		return l;
	}
};
